#include "tcp_client.h"
#include "tcp_service.h"
#include <thread>

int main() {
    // 创建并启动服务端
    RTSPServer server;
    if (!server.init("127.0.0.1")) {
        std::cerr << "服务器初始化失败" << std::endl;
        return 1;
    }
    std::thread server_thread([&]() { server.start(); });

    // 创建并启动客户端
    RTSPClient client;
    try {
        client.init("127.0.0.1");
        client.start();
    } catch (const std::runtime_error &e) {
        std::cerr << e.what() << std::endl;
        return 1;
    }

    server_thread.join();
    return 0;
}
